package io.renren.modules.communityService.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @author chenweilong
 * @email 1433471850@qq.com
 * @date 2021-03-21 13:50
 */
@Getter
public enum DbSuggestionsType implements BaseEnum{



    ZERO(0,"建议"),
    ONE(1,"投诉"),
    TWO(2,"表扬");

    @EnumValue
    @JsonValue
    private Integer key;
    private String value;

    DbSuggestionsType(Integer key, String value) {
        this.key = key;
        this.value = value;
    }



    public static DbSuggestionsType getByKey(Integer key) {
        for (DbSuggestionsType value : values()) {
            if (value.getKey().equals(key)) {
                return value;
            }
        }
        return ZERO;
    }

}
